home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac100% 1998 November
/
MAC100-1998-11.ISO.7z
/
MAC100-1998-11.ISO
/
オンラインソフト定点観測
/
ユーティリティ
/
Mops 3.2.sea
/
Mops 3.2
/
Mops source
/
PPC source
/
qBase
< prev
next >
Wrap
Text File
|
1998-05-25
|
2KB
|
87 lines
(*
This file is derived from Base. It's a "q" file - it contains any
defns from the original Base that:
1. are needed to support the compilation of the PPC image on the 68k.
2. have to be compiled BEFORE we start compiling PPC code - i.e. before
CROSS at the beginning of Setup.
So, here we only have to include words that generate 68k code, but
which for some reason get EXECUTED after CROSS-time. And of course if
the definition is identical in Base, we can omit it here.
Thus we only include words which are immediate, or which get executed
at compile time, AND are different from their original versions in Base
(e.g. words which need to refer to CDP rather than DP).
*)
¥ RECURSE isn't used in the target compilation, so we omit it here.
¥ See zBase.
¥ : CHAR @word 1+ c@ ; ¥ ANSI - replaces ASCII
: [CHAR] @word 1+ c@ postpone literal ; immediate
: & ¥ ( -- c ) A shorter state-smart version.
@word 1+ c@
state IF postpone literal THEN ; immediate
(*
note: here in Base we forward defined BLD, the word which builds an
object, which is called by the first instruction of a class dic
entry. On the PPC we'll do it via class_h, so that a class won't
look like a colon definition any more. This is a bit more logical
and shouldn't cause any problems. In any case, we couldn't use a
call to BLD as a unique marker identifying a class dic entry, since
calls are all self-relative on the PPC so that calls to any particular
word will have a different bit pattern depending on where they are.
*)
¥ ============ Tables, lists etc. ===============
¥ I don't think we use xts{ anywhere in the codegen stuff, but
¥ if we do we'll have to redefine it here since it uses RELOC,
¥ CASE can be omitted here since it's unchanged from Base while we're
¥ still generating 68k code.
(* TYPE{ and ENUM{ (synonyms) have to be defined here since CONSTANT has
been redefined. We can stop after that.
*)
0 value TYPECNT
: ENDLIST? ¥ ( chr -- b )
latest n>count 1 = down c@ = and
dup IF latest n>link (forget) THEN ;
: TYPE{ { ¥ svin -- }
0 -> typeCnt ¥ 1st value
BEGIN
>in @ -> svin
mword count " }" s=
NWHILE
svin >in !
typeCnt constant 1 ++> typeCnt
REPEAT
;
: ENUM{ type{ ; ¥ C fans might like this name better
: ENUM gobble{ type{ ;
¥ note we can't allow "type { ..." since "type" has another
¥ meaning already. But "enum { ..." is OK.
endload